package demo3;

public class ThreeTest {
    public static void main(String[] args) {
        //实例化手机卡类
        PhoneCard pc = new PhoneCard("动感地带","韩冰",99);
        //显示（卡号 + 用户名 + 当前余额）
        pc.phoneCardShow();
        System.out.println("-----------------------------------------------------");

        //实例化通话套餐类
        CallPackage cp = new CallPackage(154,100);
        //设置每月自费初始值
        cp.setRate(203);
        //显示所有套餐信息 (通话时长 + 短信条数 + 每月资费)
        cp.callPackagesShow();
        System.out.println("-----------------------------------------------------");

        //实例化上网套餐类
        OnlinePackage op = new OnlinePackage(101);
        //设置上网套餐每月资费初始值
        op.setRate(48);
        //显示所有套餐信息 (上网套餐每月资费 + 上网流量)
        op.onlinePackagesShow();
        System.out.println("-----------------------------------------------------");

        //实例化用户消费信息类
        UserConsum uc = new UserConsum(154,102111,203);
        //显示（统计通话时长 + 统计上网流量 + 每月消费金额）
        uc.UserConsumShow();
        System.out.println("-----------------------------------------------------");

        //枚举类
        PhoneCardType PhoneCardType1 = demo3.PhoneCardType.BIGC;
        String pct1 = PhoneCardType1.getCtype();
        PhoneCardType PhoneCardType2 = demo3.PhoneCardType.SMALLC;
        String pct2 = PhoneCardType2.getCtype();
        PhoneCardType PhoneCardType3 = demo3.PhoneCardType.MINIC;
        String pct3 = PhoneCardType3.getCtype();
        System.out.println("手机卡的类型:"+ pct1 + "、" + pct2 + "、" + pct3);
        System.out.println("-----------------------------------------------------");

        //多态形式调用通话套餐类CallPackage
        Package si1 = new CallPackage(300,60);
        si1.setRate(111);
        si1.showRate();
        ((CallPackage) si1).callSrvShow(120,demo3.PhoneCardType.BIGC);

        //多态形式调用上网套餐类OnlinePackage
        Package si2 = new OnlinePackage(30);
        si2.setRate(222);
        si2.showRate();
        ((OnlinePackage) si2).netSrvShow(333, PhoneCardType.MINIC);
    }
}
